package com.alibaba.citrus.cr.sales.plan.model.enums;

import java.util.Arrays;

/**
 * @author luyi
 * @date 2021/10/25 5:07 下午
 */
public enum SalesPlanModelEnum {
    /**
     * 计划业务类型
     */
    PLAN_MODEL(1,"计划提报"),
    ADJUST_MODEL(2,"计划调整");


    private Integer model;

    private String desc;

    SalesPlanModelEnum(Integer model, String desc) {
        this.model = model;
        this.desc = desc;
    }

    public Integer getModel() {
        return model;
    }

    public String getDesc() {
        return desc;
    }

    public static SalesPlanModelEnum match(Integer model){
        if (model == null){
            return null;
        }
        return Arrays.stream(values()).filter(typeEnum -> typeEnum.getModel().equals(model)).findAny().orElse(null);
    }
}
